package com.kuangjia.student_ems.service;

import com.kuangjia.student_ems.dto.LeaveDTO;
import com.kuangjia.student_ems.dto.request.LeaveRequest;
import com.kuangjia.student_ems.entity.Leave;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.time.LocalDateTime;
import java.util.List;

public interface LeaveService {
    
    LeaveDTO createLeave(Long userId, LeaveRequest request);
    
    LeaveDTO updateLeave(Long leaveId, LeaveRequest request);
    
    void deleteLeave(Long leaveId);
    
    LeaveDTO getLeaveById(Long leaveId);
    
    List<LeaveDTO> getLeavesByUser(Long userId);
    
    List<LeaveDTO> getLeavesByUserAndStatus(Long userId, Leave.LeaveStatus status);
    
    List<LeaveDTO> getLeavesByDepartment(Long departmentId);
    
    List<LeaveDTO> getPendingLeavesByDepartment(Long departmentId);
    
    List<LeaveDTO> getLeavesByDepartmentAndStatus(Long departmentId, Leave.LeaveStatus status);
    
    List<LeaveDTO> getLeavesDuringPeriod(LocalDateTime startTime, LocalDateTime endTime);
    
    List<LeaveDTO> getUserLeavesDuringPeriod(Long userId, LocalDateTime startTime, LocalDateTime endTime);
    
    LeaveDTO approveLeave(Long leaveId, Long approverId, String approveReason);
    
    LeaveDTO rejectLeave(Long leaveId, Long approverId, String rejectReason);
    
    LeaveDTO cancelLeave(Long leaveId);
    
    List<LeaveDTO> getAllLeaves();
    
    List<LeaveDTO> searchLeaves(String keyword);
    
    IPage<LeaveDTO> getLeavePage(Page<Leave> page, String keyword, Long userId, String sortField, String sortOrder);
} 